package com.yanqu.road.server.cmd.activity.tonbingchannel.channel;

import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.server.command.Cmd;
import com.yanqu.road.server.command.Command;
import com.yanqu.road.server.gameplayer.GamePlayer;
import com.yanqu.road.server.gameplayer.module.activity.tonbingchannel.ChannelTonBingModule;
import com.yanqu.road.server.manger.player.GamePlayerMgr;
import com.yanqu.road.server.protocol.GameProtocol;
import io.netty.channel.ChannelHandlerContext;

import java.util.List;

@Cmd(code = GameProtocol.S_CTON_BING_SYNC_USER_DATA, desc = "")
public class TonBingCrossSyncUserDataCmd implements Command {

    @Override
    public void execute(ChannelHandlerContext ctx, YanQuMessage packet) throws Exception {
        //有城主了，出现可以膜拜城主的图标
        List<GamePlayer> playerList = GamePlayerMgr.getAllOnlinePlayer();
        for(GamePlayer player : playerList){
            player.getModule(ChannelTonBingModule.class).syncUserData();
        }
    }
}
